package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;

@Mapper
public interface UserMapper {

    @Select("select * from user where id = #{id}")
    User getById(Long id);
    /*根据openid查修用户*/
    @Select("select * from user where openid = #{openid}")
    User getByopenId(String openid);


    /*插入新用户的数据*/
    void insert(User user);

    /**
     * 统计某天的用户总数
     * @param endTime
     * @return
     */
    Integer totalUsersByDate(LocalDateTime endTime);

    /**
     * 新增用户数量
     * @param beginTime
     * @param endTime
     * @return
     */
    Integer CntnewUser(LocalDateTime beginTime, LocalDateTime endTime);
}
